package com.danieltoms.gcSync.addressbook.widgets;

import net.rim.blackberry.api.invoke.Invoke;
import net.rim.blackberry.api.invoke.MessageArguments;
import net.rim.device.api.ui.component.LabelField;

public class ClickableEmailLabelField extends LabelField
{
	public ClickableEmailLabelField(String string)
	{
		super(string, HIGHLIGHT_FOCUS | FOCUSABLE);
	}

	protected boolean navigationClick(int status, int time)
	{
		super.navigationClick(status, time);

		// note the simulator may incorrectly show this as an SMS message
		// see
		// http://devberry.com/2008/02/22/blackberry-os-incompatibilities-and-bad-programming/
		MessageArguments args = new MessageArguments(MessageArguments.ARG_NEW, this.getText(), "", "");

		Invoke.invokeApplication(Invoke.APP_TYPE_MESSAGES, args);

		return true;
	}
}
